home *** CD-ROM | disk | FTP | other *** search
/ Champak 109 / Vol 109.iso / games / free_sty.swf / scripts / frame_15 / DoAction.as
Text File  |  2008-11-12  |  4KB  |  155 lines

  1. stop();
  2. _root.stopSound();
  3. _root.playSound();
  4. _root.score2 = _root.score;
  5. _root.bg_mc.unloadMovie();
  6. _root.attachMovie("bg" + _root.level,"bg_mc",_root.getNextHighestDepth());
  7. _root.bg_mc.swapDepths(_root.bgbg.getDepth());
  8. _root.timeC = 0;
  9. _root.win = 0;
  10. _root.llevel = 1;
  11. _root.rlevel = 2;
  12. _root.scoretxt = _root.score;
  13. if(_root.debug == 1)
  14. {
  15.    _root.showA();
  16.    for(var i in _root.zhu_array[_root.level])
  17.    {
  18.       _root.bg_mc.attachMovie("tt","tt" + i,_root.bg_mc.getNextHighestDepth(),{_x:_root.zhu_array[_root.level][i][0],_y:_root.zhu_array[_root.level][i][1],ii:i});
  19.       _root.bg_mc["tt" + i].gotoAndStop(_root.zhu_array[_root.level][i][2]);
  20.    }
  21.    _root.ttn = _root.zhu_array[_root.level].length;
  22. }
  23. _root.onEnterFrame = function()
  24. {
  25.    _root.mxx = _root.bg_mc.man._x;
  26.    _root.myy = _root.bg_mc.man._y;
  27.    _root.bxx = _root.bg_mc.man._x * _root.bg_mc._xscale / 100 + _root.bg_mc._x;
  28.    _root.byy = _root.bg_mc.man._y * _root.bg_mc._yscale / 100 + _root.bg_mc._y;
  29.    _root.ff = _root.bg_mc.man._xscale / Math.abs(_root.bg_mc.man._xscale);
  30.    if(_root.zt == "walk" || _root.zt == "stand")
  31.    {
  32.       _root.ationd = 0;
  33.       if(Key.isDown(39))
  34.       {
  35.          _root.xy = _root.getvv(0,_root.rlevel);
  36.          _root.bg_mc.man._x += _root.xy.xx;
  37.          _root.bg_mc.man._y += _root.xy.yy;
  38.          _root.bg_mc.man._xscale = Math.abs(_root.bg_mc.man._xscale);
  39.          if(_root.zt != "walk")
  40.          {
  41.             _root.bg_mc.man.gotoAndPlay("σÑöΦ╖æ");
  42.             _root.zt = "walk";
  43.          }
  44.       }
  45.       else if(Key.isDown(37))
  46.       {
  47.          _root.xy = _root.getvv(1,_root.llevel);
  48.          _root.bg_mc.man._x += _root.xy.xx;
  49.          _root.bg_mc.man._y += _root.xy.yy;
  50.          _root.bg_mc.man._xscale = - Math.abs(_root.bg_mc.man._xscale);
  51.          if(_root.zt != "walk")
  52.          {
  53.             _root.bg_mc.man.gotoAndPlay("σÑöΦ╖æ");
  54.             _root.zt = "walk";
  55.          }
  56.       }
  57.       else
  58.       {
  59.          _root.bg_mc.man.gotoAndStop("stand");
  60.          _root.zt = "stand";
  61.       }
  62.    }
  63.    if(_root.bxx >= _root.fx && _root.bg_mc._x > 600 - _root.bg_mc._width + 20)
  64.    {
  65.       _root.bg_mc._x += _root.fx - _root.bxx;
  66.    }
  67.    if(_root.bxx <= _root.bx && _root.bg_mc._x < -10)
  68.    {
  69.       _root.bg_mc._x += _root.bx - _root.bxx;
  70.    }
  71.    _root.bg_mc.tiao();
  72.    _root.af(_root.lr,_root.ddi);
  73.    if(Key.isDown(192))
  74.    {
  75.       System.setClipboard(_root.txt1.text);
  76.    }
  77.    if(Key.isDown(65))
  78.    {
  79.       _root.setb = "add";
  80.    }
  81.    if(Key.isDown(68))
  82.    {
  83.       _root.setb = "del";
  84.    }
  85.    if(Key.isDown(66))
  86.    {
  87.       _root.setb = "bian";
  88.    }
  89.    if(Key.isDown(83))
  90.    {
  91.       _root.setb = "set";
  92.    }
  93.    var _loc2_ = 1;
  94.    while(_loc2_ <= 8)
  95.    {
  96.       if(_loc2_ <= _root.life)
  97.       {
  98.          _root["xin" + _loc2_]._alpha = 100;
  99.       }
  100.       else
  101.       {
  102.          _root["xin" + _loc2_]._alpha = 0;
  103.       }
  104.       _loc2_ = _loc2_ + 1;
  105.    }
  106.    if(_root.scoretxt < _root.score)
  107.    {
  108.       if(_root.scoretxt - _root.score > -4)
  109.       {
  110.          _root.scoretxt = _root.score;
  111.       }
  112.       else
  113.       {
  114.          _root.scoretxt += 4;
  115.       }
  116.    }
  117.    if(_root.scoretxt > _root.score)
  118.    {
  119.       if(_root.scoretxt - _root.score < 4)
  120.       {
  121.          _root.scoretxt = _root.score;
  122.       }
  123.       else
  124.       {
  125.          _root.scoretxt -= 4;
  126.       }
  127.    }
  128.    if(_root.timeC == 0 && _root.win == 0)
  129.    {
  130.       _root.timeC = getTimer();
  131.    }
  132.    _root.timeF();
  133.    if(_root.win == 0 && Math.abs(_root.bg_mc.man._x - zhu_array[_root.level][_root.winat[_root.level]][0]) <= 5 && Math.abs(_root.bg_mc.man._y - zhu_array[_root.level][_root.winat[_root.level]][1]) <= 5)
  134.    {
  135.       _root.win = 1;
  136.       delete _root.onEnterFrame;
  137.    }
  138. };
  139. if(_root.debug == 1)
  140. {
  141.    _root.bg_mc.onMouseDown = function()
  142.    {
  143.       if(_root.setb == "add")
  144.       {
  145.          var _loc3_ = _root.bg_mc._xmouse;
  146.          var _loc2_ = _root.bg_mc._ymouse;
  147.          _root.bg_mc.attachMovie("tt","tt" + _root.ttn,_root.bg_mc.getNextHighestDepth(),{_x:_loc3_,_y:_loc2_,ii:_root.ttn});
  148.          _root.setb = "";
  149.          _root.ttn = _root.ttn + 1;
  150.          _root.zhu_array[_root.level].push([_loc3_,_loc2_,1,0]);
  151.          _root.showA();
  152.       }
  153.    };
  154. }
  155.